import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AttendanceDetailStatusVO, AttendanceDetailStatusForm, AttendanceDetailStatusQuery } from '@/api/dormitory/attendanceDetailStatus/types';

/**
 * 查询宿舍考勤明细状态列表
 * @param query
 * @returns {*}
 */

export const listAttendanceDetailStatus = (query?: AttendanceDetailStatusQuery): AxiosPromise<AttendanceDetailStatusVO[]> => {
  return request({
    url: '/dormitory/attendanceDetailStatus/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询宿舍考勤明细状态详细
 * @param id
 */
export const getAttendanceDetailStatus = (id: string | number): AxiosPromise<AttendanceDetailStatusVO> => {
  return request({
    url: '/dormitory/attendanceDetailStatus/' + id,
    method: 'get'
  });
};

/**
 * 新增宿舍考勤明细状态
 * @param data
 */
export const addAttendanceDetailStatus = (data: AttendanceDetailStatusForm) => {
  return request({
    url: '/dormitory/attendanceDetailStatus',
    method: 'post',
    data: data
  });
};

/**
 * 修改宿舍考勤明细状态
 * @param data
 */
export const updateAttendanceDetailStatus = (data: AttendanceDetailStatusForm) => {
  return request({
    url: '/dormitory/attendanceDetailStatus',
    method: 'put',
    data: data
  });
};

/**
 * 删除宿舍考勤明细状态
 * @param id
 */
export const delAttendanceDetailStatus = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dormitory/attendanceDetailStatus/' + id,
    method: 'delete'
  });
};
